﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CH02_04
{
    class CH02_04
    {
        static void Main(string[] args)
        {
            // 定义变量;
            int iNumber1, iNumber2;
            int iSum, iDifference, iProduct, iQuotient;
            string strInput1, strInput2;

            Console.WriteLine("请输入整数1:");
            strInput1 = Console.ReadLine();

            Console.WriteLine("请输入整数2(非零):");
            strInput2 = Console.ReadLine();

            // 输入转换为整数;
            iNumber1 = int.Parse(strInput1);
            iNumber2 = int.Parse(strInput2);

            // 计算两个整数的和、差、积、商;
            iSum = iNumber1 + iNumber2;
            iDifference = iNumber1 - iNumber2;
            iProduct = iNumber1 * iNumber2;
            iQuotient = iNumber1 / iNumber2;

            // 将计算结果输出到控制台;
            Console.WriteLine("整数的和:" + iSum);
            Console.WriteLine("整数的差:" + iDifference);
            Console.WriteLine("整数的积:" + iProduct);
            Console.WriteLine("整数的商:" + iQuotient);
        }
    }
}
